# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=voiphopper
pkgver=2.04
pkgrel=7
groups=('blackarch' 'blackarch-automation' 'blackarch-voip')
pkgdesc='A security validation tool that tests to see if a PC can mimic the behavior of an IP Phone. It rapidly automates a VLAN Hop into the Voice VLAN.'
arch=('x86_64' 'aarch64')
url='http://voiphopper.sourceforge.net/'
license=('GPL3')
depends=('libpcap' 'gcc')
source=("http://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.gz")
sha512sums=('6b8afcd5600c719e6470a64d84083269405b5548477c9221636b48aad295634839c621ebb7b736680acb64c987a3311d95929ab5d041419aa5375471ef773e29')

build() {
  cd "$pkgname-$pkgver"

  ./configure --prefix=/usr --mandir=/usr/share/man --libexecdir=/usr/lib

  sed -i "s%<linux/if_ether.h>%<netinet/if_ether.h>%" src/dhcpclient.h
  sed -i "s%<linux/if_tr.h>%<netinet/if_tr.h>%" src/dhcpclient.h

  make
}

package() {
  cd "$pkgname-$pkgver"

  install -dm 755 "$pkgdir/usr/bin"

  make DESTDIR="$pkgdir" install

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README BUGS
}

